package com.share.chat.controller;

import com.share.chat.domain.ResultInfo;
import com.share.chat.domain.User;
import com.share.chat.service.SearchService;
import com.share.chat.vo.SearchUsersData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 谢佳豪
 * @data 2021/7/4 - 12:41
 * @description 搜索控制器
 */
@Controller
@ResponseBody
@RequestMapping("/search")
public class SearchController {

    private SearchService searchService;

    @Autowired
    public void setSearchService(SearchService searchService) {
        this.searchService = searchService;
    }

    @GetMapping("/user")
    public ResultInfo searchUsers(){
        List<SearchUsersData> searchUsersData = searchService.searchUsers();
        return ResultInfo.successInfo("查询成功！", searchUsersData);
    }



}
